package com.uziot.activiti6.service;

import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author shidt
 * @version V1.0
 * @className ProcessDefinitionService
 * @date 2021-02-26 10:38:41
 * @description 工作流服务接口
 */

public interface ProcessDefinitionService {
    /**
     * 删除流程定义
     *
     * @param id id
     * @return int
     */
    int deleteProcessDefinitionById(String id);

    /**
     * 删除流程定义
     *
     * @return int
     */
    int deleteAllProcessDefinition();

    /**
     * 上传流程流程定义
     *
     * @param multipartFile multipartFile
     * @return String
     * @throws IOException 异常
     */
    String upload(MultipartFile multipartFile) throws IOException;

    /**
     * 上传并部署流程定义
     *
     * @param file file
     * @throws IOException IOException
     */
    void uploadStreamAndDeployment(MultipartFile file) throws IOException;

    /**
     * 启动挂起流程流程定义
     *
     * @param id           流程定义id
     * @param suspendState 流程状态
     */
    void suspendOrActiveApply(String id, Integer suspendState);


    /**
     * 通过stringBPMN添加流程定义
     *
     * @param stringBpmn stringBpmn
     */
    void addDeploymentByString(String stringBpmn);

    /**
     * 获取流程定义XML
     *
     * @param response     response
     * @param deploymentId deploymentId
     * @param resourceName resourceName
     * @throws IOException io异常
     */
    void getProcessDefineXml(HttpServletResponse response, String deploymentId, String resourceName) throws IOException;
}
